package com.zj.sms.constant;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class Constants {
	public static final String charSet = "utf-8";
	public static final int index = 4;//最大允许遍历深度
	public static String path = "d://httpdown/2/";//保存文件目录
	
	public static String tag = "/\\";
	public static final int fixNum = 4;//截取url前fixNum个/的字符串
	public static String filterPath = "config/filter.txt";//过滤文件目录
	public static Set<String> filterList = new HashSet<String>();//文件目录内的过滤列表
	//取url前fixNum个字符 pre，如果该url多次没有取到特征数据，则将pre加入filterList中，后面的url中如果包含pre，则直接过滤不要
	public static final int filterN = 5;
	public static Map<String,Integer> countMap = new HashMap<String,Integer>();
	static{
		File file = new File(filterPath);
		if(!file.exists()){
			try {
				file.createNewFile();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		try {
			List<String> list = org.apache.commons.io.FileUtils.readLines(file, charSet);
			filterList = new HashSet<String>(list);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
